package com.yuexun.beilunpatient.ui.registration.model.impl;

import com.yuexun.beilunpatient.ui.registration.api.RegistrationPayApi;
import com.yuexun.beilunpatient.ui.registration.model.IRegistrationPayModel;
import com.yuexun.beilunpatient.utils.ApiUtil;

import java.util.Map;

import rx.Observable;

/**
 * Created by chenss on 2018/11/23.
 */
public class RegistrationPayModel implements IRegistrationPayModel {

    private RegistrationPayApi api;

    //记录Log
//    private final Logger log = ProUtil.getLogger(LoginModel.class);

    public RegistrationPayApi ApiInstance() {
        if (api != null) {
            return api;
        } else {
            return ApiUtil.getInstance().createRetrofitPayApi(RegistrationPayApi.class);
        }
    }

    @Override
    public Observable<String> generatePayOrder(Map<String, String> praise) {
        api = ApiInstance();
        return api.generatePayOrder(praise);
    }
}
